<h1>Clan wars</h1><a href="<?php echo url_for('war/new') ?>">Add new Clan war</a>

<h2>Upcoming</h2>
<table>
  <thead>
    <tr>      
      <th>Red</th>
      <th>Blue</th>
	  
      <th>Date</th>
	  <th>Game</th>
      <th>Mode</th>
      <th>Event</th>      
    </tr>
  </thead>
  <tbody>
    <?php foreach ($upcoming as $war): ?>
    <tr>      
      <td>
		<img src="../images/flags/<?php echo $war->getClan()->getCountry()->getFlag() ?>" alt="<?php echo $war->getClan()->getCountry()->getFlag() ?>" />
		<?php echo $war->getClan() ?>
	  </td>	  	 
      <td>
		<img src="../images/flags/<?php echo $war->getClan_4()->getCountry()->getFlag() ?>" alt="<?php echo $war->getClan_4()->getCountry()->getFlag() ?>" />
		<?php echo $war->getClan_4() ?>
	  </td>	  
      <td><a href="<?php echo url_for('war/show?id='.$war->getId()) ?>"><?php echo $war->getDate() ?></a></td>
	  <td><?php echo $war->getMode()->getGame()->getShort() ?></td>
      <td><?php echo $war->getMode() ?></td>
      <td><?php echo $war->getEvent() ?></td>
      
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>

<h2>Played</h2>
<table>
  <thead>
    <tr>      
      <th>Red</th>
      <th>Blue</th>
	  
      <th>Date</th>
	  <th>Game</th>
      <th>Mode</th>
      <th>Event</th>      
    </tr>
  </thead>
  <tbody>
    <?php foreach ($played as $res): ?>
    <tr>      
      <td>
		<img src="../images/flags/<?php echo $res->getClan()->getCountry()->getFlag() ?>" alt="<?php echo $res->getClan()->getCountry()->getFlag() ?>" />
		<?php echo $res->getClan() ?>
	  </td>	  	 
      <td>
		<img src="../images/flags/<?php echo $res->getClan_4()->getCountry()->getFlag() ?>" alt="<?php echo $res->getClan_4()->getCountry()->getFlag() ?>" />
		<?php echo $res->getClan_4() ?>
	  </td>	  
      <td><a href="<?php echo url_for('war/show?id='.$res->getId()) ?>"><?php echo $res->getDate() ?></a></td>
	  <td><?php echo $res->getMode()->getGame()->getShort() ?></td>
      <td><?php echo $res->getMode() ?></td>
      <td><?php echo $res->getEvent() ?></td>
      
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>  
